package models;

import java.util.*;

import javax.persistence.*;

import play.db.jpa.*;

@Entity
public class User extends Model {
	public String name;
	public String gender;
	public String userName;
	public String password;
	public Date dateOfBirth;
	public String email;
	public String address;
	public int contribution;
	@OneToMany(mappedBy = "creator", cascade = CascadeType.ALL)
	List<Plan> plans;
	@OneToMany(mappedBy = "owner", cascade = CascadeType.ALL)
	List<ActionLog> actions;
	@ManyToMany
	List<Idea> duplicatedIdeas;
	@ManyToMany
	List<Idea> subscribedIdeas;
	@ManyToMany
	List<ActionItem> actionItems;
	@ManyToMany
	List<EEntity> workingOn;
	@ManyToMany
	List<EEntity> organizing;
	@OneToMany(mappedBy = "creator")
	List<Topic> createdTopics;
	@ManyToMany
	List<Topic> subscribedTopics;
	@ManyToMany
	List<Notification> notifications;
	@OneToMany(mappedBy = "creator")
	List<Idea> createdIdeas;
	@ManyToMany
	List<Idea> ratedIdeas;
	@OneToMany(mappedBy = "creator")
	List<Comment> createdComments;
	@ManyToMany
	List<Tag> subscribedTags;

	public User(String name, String gender, String userName, String password,
			Date dateOfBirth, String email, String address) {
		this.name = name;
		this.gender = gender;
		this.userName = userName;
		this.password = password;
		this.dateOfBirth = dateOfBirth;
		this.email = email;
		this.address = address;
		this.contribution = 0;
		plans = new ArrayList<Plan>();
		duplicatedIdeas = new ArrayList<Idea>();
		subscribedIdeas = new ArrayList<Idea>();
		actionItems = new ArrayList<ActionItem>();
		workingOn = new ArrayList<EEntity>();
		organizing = new ArrayList<EEntity>();
		createdTopics = new ArrayList<Topic>();
		subscribedTopics = new ArrayList<Topic>();
		notifications = new ArrayList<Notification>();
		createdIdeas = new ArrayList<Idea>();
		ratedIdeas = new ArrayList<Idea>();
		createdComments = new ArrayList<Comment>();
		subscribedTags = new ArrayList<Tag>();
	}
}
